﻿<phone:PhoneApplicationPage 
    x:Class="PhoneApp1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    xmlns:my="clr-namespace:PhoneApp1">

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel 包含应用程序的名称和页标题-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="TCP Socket Application" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Client" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - 在此处放置其他内容-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <!-- Fit to content -->
                <ColumnDefinition Width="Auto"/>
                <!-- Fit to content -->
                <ColumnDefinition Width="Auto"/>
                <!-- Fit to content -->
                <ColumnDefinition Width="*"/>
                <!-- Take up remaining space -->
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <!-- Fit to content -->
                <RowDefinition Height="Auto"/>
                <!-- Fit to content -->
                <RowDefinition Height="Auto"/>
                <!-- Fit to content -->
                <RowDefinition Height="*"/>
                <!-- Take up remaining space -->
            </Grid.RowDefinitions>

            <!-- Grid Row 0: Remote Host Input Field >-->
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Host Name:"  
                       VerticalAlignment="Center" HorizontalAlignment="Center" 
                       FontSize="{StaticResource PhoneFontSizeNormal}" />
            <TextBox x:Name="txtRemoteHost" Grid.Row="0" Grid.Column="1"  Height="70" Width="200" 
                     VerticalAlignment="Top" HorizontalAlignment="Left" 
                     FontSize="{StaticResource PhoneFontSizeNormal}"  />

            <!-- Grid Row 1: Echo >-->
            <!-- TextBlock for Echo command label-->
            <TextBlock Grid.Row="1" Grid.Column="0" Text="Text To Echo:" 
                       VerticalAlignment="Center" HorizontalAlignment="Center" 
                       FontSize="{StaticResource PhoneFontSizeNormal}" />

            <!-- TextBox for Echo command text input-->
            <TextBox x:Name="txtInput" Grid.Row="1" Grid.Column="1" Height="70" Width="200"  
                     VerticalAlignment="Top" HorizontalAlignment="Left" 
                     FontSize="{StaticResource PhoneFontSizeNormal}" />

            <!-- Button to the right of the input textbox for the Echo command >-->
            <Button x:Name="btnEcho" Grid.Row="1" Grid.Column="2" Height="70"  Width="120" 
                    Content="Echo" 
                    FontSize="{StaticResource PhoneFontSizeNormal}" Click="btnEcho_Click"/>

            <!-- Grid Row 2: Quote of the Day-->
            <!-- Button for the Quote command >-->
            <Button x:Name="btnGetQuote" Grid.Row="2" Grid.ColumnSpan="4" Height="70" 
                    Content="Get Quote of the Day" 
                    FontSize="{StaticResource PhoneFontSizeNormal}" Click="btnGetQuote_Click"/>

            <!-- Grid Row 3: Output-->
            <!-- Output TextBox named 'txtOutput' >-->
            <TextBox x:Name="txtOutput" Grid.Row="3" Grid.ColumnSpan="4" Background="Black" BorderBrush="Green" 
                     AcceptsReturn="False" Foreground="LightGray" FontFamily="Courier New"  
                     IsHitTestVisible="False" FontSize="{StaticResource PhoneFontSizeSmall}" TextWrapping="Wrap" />
        </Grid>
        <my:ButtonEx Content="TEST" Height="72" Width="160" Margin="10,10,0,0" Background="Red" PressedBackground="Green"/>
    </Grid>
 
    <!--演示 ApplicationBar 用法的示例代码-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="按钮 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="按钮 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="菜单项 1"/>
                <shell:ApplicationBarMenuItem Text="菜单项 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>